package com.block.common.enums;

import cn.hutool.core.util.StrUtil;
import lombok.Getter;

@Getter
public enum ApiReqEnum {

    DEFAULT("default", "默认类型", "DEFAULT"),
    PROD_LIST("/api/product/list", "产品列表UV", "PROD_LIST"),
    PROD_UV("/api/sys/count", "产品点击UV", "PROD_UV"),
    CHANNEL_UV("/exp/chl", "渠道uv", "CHANNLE_UV"),
    ;

    String value;
    String name;
    String type;

    ApiReqEnum(String value, String name, String type){
        this.value = value;
        this.name = name;
        this.type = type;
    }

    public static ApiReqEnum getEntityByType(String type){
        for (ApiReqEnum item: values()){
            if (StrUtil.equals(item.getType(), type)){
                return item;
            }
        }
        return DEFAULT;
    }

}
